const express = require('express')
const router = express.Router()
const dept_hander = require('../router_hander/dept')
//导入@escook/express-joi模块
const expressJoi = require('@escook/express-joi')
//导入schema模块
const {reg_regdeptadd_schema} = require('../schema/index')
//查询所有信息
router.get('/dept/userinfo/:page/:limit',dept_hander.reqDeptUserInfo)
//新增部门信息
router.post('/dept/adddept',expressJoi(reg_regdeptadd_schema),dept_hander.reqAddDept)
//查询使用的部门信息
router.get('/dept/usedept/:page/:limit',dept_hander.reqSelectUseDept)
//查询未使用的部门信息
router.get('/dept/dontusedept/:page/:limit',dept_hander.reqSelectDontUseDept)
//部门编辑
router.post('/dept/editdept',dept_hander.reqEditDept)
//部门删除
router.get('/dept/deletedept/:did',dept_hander.reqDeleteDept)
//部门撤销删除
router.get('/dept/dontdeletedept/:did',dept_hander.reqDontDeleteDept)
module.exports = router